package test.db.mysql.table;

public enum QuestionTable implements Table {
    SID(Column.sid),
    PID(Column.pid),
    QUESTION(Column.question),
    GRADE(Column.grade),
    EXAMPLE(Column.example),
    PATTERN_CODE(Column.patternCode),
    HEARING_YN(Column.hearingYn),
    CLASSIFICATION(Column.classification),
    STATE(Column.state),
    SHARE_YN(Column.shareYn),
    USER_SID(Column.userSid),
    MODIFY_DATE(Column.modifyDate),
    MODIFY_TIME(Column.modifyTime),
    REGIST_DATE(Column.registDate),
    REGIST_TIME(Column.registTime),
    USE_YN(Column.useYn);
    
    private final Column column;
    private static final String TYPE_SID = "VARCHAR(20)";
    private static final String TYPE_PID = "VARCHAR(20)";
    private static final String TYPE_QUESTION = "VARCHAR(1024)";
    private static final String TYPE_GRADE = "VARCHAR(12)";
    private static final String TYPE_EXAMPLE = "TEXT";
    private static final String TYPE_PATTERN_CODE = "VARCHAR(12)";
    private static final String TYPE_HEARING_YN = "VARCHAR(1)";
    private static final String TYPE_CLASSIFICATION = "VARCHAR(12)";
    private static final String TYPE_STATE = "VARCHAR(12)";
    private static final String TYPE_SHARE_YN = "VARCHAR(1)";
    private static final String TYPE_USER_SID = "VARCHAR(20)";
    private static final String TYPE_MODIFY_DATE = "VARCHAR(8)";
    private static final String TYPE_MODIFY_TIME = "VARCHAR(6)";
    private static final String TYPE_REGIST_DATE = "VARCHAR(8)";
    private static final String TYPE_REGIST_TIME = "VARCHAR(6)";
    private static final String TYPE_USE_YN = "VARCHAR(1)";

    QuestionTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        sid {
            String getType() {
                return TYPE_SID;
            }
        },
        
        pid {
            String getType() {
                return TYPE_PID;
            }
        },
        
        question {
            String getType() {
                return TYPE_QUESTION;
            }
        },
        
        grade {
            String getType() {
                return TYPE_GRADE;
            }
        },
        
        example {
            String getType() {
                return TYPE_EXAMPLE;
            }
        },
        
        patternCode {
            String getType() {
                return TYPE_PATTERN_CODE;
            }
        },
        
        hearingYn {
            String getType() {
                return TYPE_HEARING_YN;
            }
        },
        
        classification {
            String getType() {
                return TYPE_CLASSIFICATION;
            }
        },
        
        state {
            String getType() {
                return TYPE_STATE;
            }
        },
        
        shareYn {
            String getType() {
                return TYPE_SHARE_YN;
            }
        },
        
        userSid {
            String getType() {
                return TYPE_USER_SID;
            }
        },
        
        modifyDate {
        	String getType() {
        		return TYPE_MODIFY_DATE;
        	}
        },
        
        modifyTime {
        	String getType() {
        		return TYPE_MODIFY_TIME;
        	}
        },
        
        registDate {
        	String getType() {
        		return TYPE_REGIST_DATE;
        	}
        },
        
        registTime {
        	String getType() {
        		return TYPE_REGIST_TIME;
        	}
        },
        
        useYn {
            String getType() {
                return TYPE_USE_YN;
            }
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
        System.out.println("CALL NOW");
    }
}
